package star.cloud.asme.system.permission;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import star.cloud.asme.base.mybatis.IBaseMapper;

import java.util.List;

@Mapper
//@CacheNamespace
public interface PermissionMapper extends IBaseMapper<Permission> {

    List<Permission> selectListByMenuTitle(String menuTitle);

    int deleteByRoleNameAndMenuTitle(String roleName, String menuTitle);

    int insertRoleAndMenuAndButton(String roleName, String menuTitle, String permissionText);

    List<String> selectPermissionTextListByRoleNameAndMenuTitle(String roleName, String menuTitle);

    int deleteByRoleNameMenuTitle(@Param("roleName") String roleName, @Param("menuTitle") String menuTitle);

    int deleteByRoleName(String roleName);

    List<String> selectPermissionTextListByUserId(Long userId);
}